<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- 引入主题样式 -->
<link href="themes/gray/easyui.css" rel="stylesheet">
<!-- 引入图标的样式 -->
<link href="themes/icon.css" rel="stylesheet">
<!-- 先引入jquery -->
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<!-- 引入easyui -->
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="js/easyui-lang-zh_CN.js"></script>
</head>
<!-- 用easyUI来写    -->
<script type="text/javascript">
	$(function() {
		//构件登陆的窗口
		$('#win').window({
			width : 600,
			height : 400,
			collapsible : false,
			maximizable : false,
			closable : false,
			title : "登录窗口",
			minimizable : false,
			resizable : false,
			draggable : false,
		});
		//登录窗口
		$('#uname').textbox({
			iconCls : 'icon-man',
			iconAlign : 'left',
			prompt : '请输入账号',
			height : 40,
			type : 'text',
		});

		$('#upassword').textbox({
			iconCls : 'icon-lock',
			iconAlign : 'left',
			prompt : '请输入密码',
			height : 40,
			type : 'password',
		});
		//处理表单返回信息
		$('#uform').form({
			url:'login',  
			 success:function(data){
			    	var data=eval('('+data+')');
			    	if(data.s){
			    		location.href='main.jsp'
			    	}else{
			    		$.messager.alert('警告弹窗',data.msg,'info',function(){
			    			//无参数的调用方法
			    			$("#username").textbox('clear');
			    			$("#password").textbox('clear');
			    		}) 
			    	}      	
			    }
	});
		

		$('#btn').linkbutton({
			iconCls : 'icon-search',
			iconAlign : 'right',
			onClick : function() {
			$('#uform').form('submit');
			}
		});
		
	});
</script>
<body>


	<div id="win">
		<form id="uform" method="post" >
			<div style="margin-left: 110px; margin-top: 130px" >
			
				<input id="uname" name="username" style="width: 300px"> <br>
				<br> 
				<input id="upassword" name="password" style="width: 300px">
				<br> 
				<input type="hidden" name="Reqtoken" value="${token}">
			·
				<a id="btn" href="#">登录账户</a>
				<!-- 没有参数传出 -->
			</div>
		</form>


	</div>


</body>
</html>